<template>
  <div class="container el-form-item-noerror">
    <el-form class="input-form"
             label-position="right"
             label-width="120px"
             ref="editForm"
             :rules="propRules"
             :disabled="propReadonly"
             :model="form"
    >

      <el-row :gutter="20">
        <el-col :span="14">
          <el-collapse v-model="activeNames" >

            <!--中标要求-->
            <el-collapse-item title="询价要求(输入完自动保存)" name="12">
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item  label="中标参考价" prop="officialPrice" required >
                    <el-input-number @change="saveApplyDtl(1)"  ref="officialPrice" :disabled="propInitData.opType != 1"   v-model="form.officialPrice" :precision="2" :step="10" :max="999999999"></el-input-number>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="参考价来源" prop="officialPriceSrc" required>
                    <el-select @change="saveApplyDtl(1)"  ref="officialPriceSrc" :disabled="propInitData.opType != 1"  v-model="form.officialPriceSrc" placeholder="请选择">
                      <el-option
                        v-for="item in options"
                        :key="item.value"
                        :label="item.label"
                        :value="item.value">
                      </el-option>
                    </el-select>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="最低限价" prop="skuPriceMin" required>
                    <el-input-number @change="saveApplyDtl(1)"  :disabled="propInitData.opType != 1" ref="skuPriceMin"  v-model="form.skuPriceMin" :precision="2" :step="10" :max="999999999"></el-input-number>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="高限价" prop="skuPriceMax" required>
                    <el-input-number @change="saveApplyDtl(1)"  :disabled="propInitData.opType != 1" ref="skuPriceMax" v-model="form.skuPriceMax" :precision="2" :step="10" :max="999999999"></el-input-number>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="送货地址" prop="deliverAddress">
                    <el-input @change="saveApplyDtl(1)"  :disabled="propInitData.opType != 1" v-model="form.deliverAddress" size="medium" type="textarea" :autosize="{ minRows: 1, maxRows: 4}"/>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="询价说明" prop="inquiryRemark">
                    <el-input @change="saveApplyDtl(1)"  :disabled="propInitData.opType != 1" v-model="form.inquiryRemark" size="medium" type="textarea" :autosize="{ minRows: 1, maxRows: 4}"/>
                  </el-form-item>
                </el-col>
              </el-row>
            <!--  <el-row :gutter="20" v-show="propInitData.opType == 1">
                <el-col :span="24" style="text-align: right">
                  <el-button :disabled="propInitData.opType != 1" type="primary" @click="saveApplyDtl(1)" size="small">保存询价要求</el-button>
                </el-col>
              </el-row>-->

              <el-collapse v-model="activeNames"   class="target">
                <!--参与询价供应商列表-->
                <el-collapse-item title="参与询价供应商列表" name="66">
                  <el-row :gutter="20" v-show="propInitData.opType == 1">
                    <el-col :span="12">
                      <el-form-item label="供应商" prop="supplierNameTarget" required>
                        <FortenDataviewDown
                          ref="supplierNameTarget"
                          propDownType="form"
                          propFieldText="supplierNameTarget"
                          :propForm="form"
                          @select-change="selectChange"
                          :propUserParam="{viewKey: 'base_supplier'}"
                        ></FortenDataviewDown>
                      </el-form-item>
                    </el-col>
                    <el-col :span="12">
                      <el-form-item label="新供应商" prop="supplierNameTarget" required>
                        <el-input v-model="form.supplierNameNewTarget" />
                      </el-form-item>
                    </el-col>
                  </el-row>
                  <el-row :gutter="20"  v-show="propInitData.opType == 1">
                    <el-col :span="8">
                      <el-form-item label="联系人" prop="supplierContactor" >
                        <el-input ref="supplierContactor" v-model="form.supplierContactor" />
                      </el-form-item>
                    </el-col>
                    <el-col :span="8">
                      <el-form-item label="联系电话" prop="supplierTel">
                        <el-input ref="supplierTel" v-model="form.supplierTel" type="number" />
                      </el-form-item>
                    </el-col>
                    <el-col :span="8" style="text-align:right">
                      <el-button type="primary" @click="addTarget" size="small">添加到询价列表</el-button>
                    </el-col>
                  </el-row>
                  <el-row :gutter="20">
                    <el-col :span="24">
                      <data-view
                        propViewKey="adm_matr_inquiry_target"
                        ref="dataViewTarget"
                        class="data-view-inlinebtn"
                        :propPageSize="3"
                        :propAutoFetchData="false"
                        :propHideQueryButton="true"
                        :propHideAllButton="propInitData.opType != 1"
                      >
                      </data-view>
                    </el-col>
                  </el-row>
                </el-collapse-item>
              </el-collapse>

            </el-collapse-item>

            <!--报价结果-->
            <el-collapse-item title="报价结果" name="15"  >
              <data-view
                propViewKey="adm_matr_inquiry_result"
                ref="dataViewResult"
                class="data-view-inlinebtn"
                :propPageSize="3"
                :propAutoFetchData="false"
                :propHideQueryButton="true"
                :propCustomCols="propCustomCols"
                @extra-button-click="handleExtraButton"
              >
                <template #btns="{field,value,row}" >
                  <el-button-group>
                    <el-button v-show="propInitData.opType == 3" type="primary" size="mini" @click="saveApplyDtl(3,row)" >中标</el-button>
                  </el-button-group>
                </template>
              </data-view>
            </el-collapse-item>

            <!--报价资质-->
            <el-collapse-item title="报价资质" name="16"  >
              <el-tabs tab-position="left"  >
                <el-tab-pane :label="spName" v-for="spName in certSPNameArr" :key="spName">
                  <FortenUpload
                    :title="'申请材料'"
                    :fileType="'all'"
                    :fileMaxNum="999"
                    :fileSize="100"
                    :readonly="true"
                    :propIsView="true"
                    :propFileList="getSpCert(spName)"
                  ></FortenUpload>
                </el-tab-pane>
              </el-tabs>
            </el-collapse-item>


            <!--中标结果-->
            <el-collapse-item title="中标结果(输入完自动保存)" name="13"  >
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="供应商代码" prop="supplierCode" >
                    {{form.supplierCode}}
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="供应商名称" prop="supplierName">
                    {{form.supplierName}}
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="采购价格" prop="skuPricePurchase" >
                    <el-input-number ref="skuPricePurchase" @change="saveApplyDtl(2)"  :disabled="propInitData.opType != 3" v-model="form.skuPricePurchase"  :precision="2" :step="10"  ></el-input-number>
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="销售价格" prop="skuPriceSell">
                    <el-input-number ref="skuPriceSell" @change="saveApplyDtl(2)"  :disabled="propInitData.opType != 3" v-model="form.skuPriceSell"  :precision="2" :step="10" ></el-input-number>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="中标号" prop="bidNo" >
                    <el-input ref="bidNo" v-model="form.bidNo"  :disabled="propInitData.opType != 3" @change="saveApplyDtl(2)"  />
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="注册证号" prop="certificateNo" >
                    <el-input ref="bidNo" v-model="form.certificateNo"  :disabled="propInitData.opType != 3" @change="saveApplyDtl(2)"  />
                  </el-form-item>
                </el-col>
              </el-row>
            </el-collapse-item>
          </el-collapse>
        </el-col>
        <el-col :span="10">
          <el-collapse v-model="activeNames">
            <!--科室需求-->
            <el-collapse-item title="科室需求" name="11" class="area-dept">
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="品名" prop="matrName" >
                    {{form.matrName}}
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="品规" prop="matrSpec">
                    {{form.matrSpec}}
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="厂商" prop="mfgName">
                    {{form.mfgName}}
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="单位" prop="skuUnit">
                    {{form.skuUnit}}
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="品类" prop="skuUnit">
                    {{form.categoryName}}
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="预估价格" prop="skuPrice">
                    {{form.skuPrice}}
                  </el-form-item>
                </el-col>
                <el-col :span="12">
                  <el-form-item label="预估用量/年" prop="skuPrice">
                    {{form.qtyYear}}
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="8">
                  <el-form-item label="是否阳采" prop="flagSunpurchase" >
                    <el-switch v-model="form.flagSunpurchase" active-color="#13ce66" disabled  />
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="阳采代码" prop="sunpurchaseCode">
                    {{form.sunpurchaseCode}}                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="备案采购" prop="flagRecordPurchase" >
                    <el-switch v-model="form.flagRecordPurchase" disabled active-color="#13ce66"/>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="12">
                  <el-form-item label="欲淘汰品牌" prop="eliminateMatrName">
                    {{form.eliminateMatrName}}
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="新品优势" prop="advantageRemark">
                    {{form.advantageRemark}}
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="使用范围" prop="useScopuseScopeNames">
                    <el-radio-group disabled v-model="admUseScopecheck">
                      <el-radio
                        v-for="item in utils.getDictDataList('adm_use_scope')"
                        :key="item.value"
                        :label="item.value"
                      >{{item.label}}</el-radio>
                    </el-radio-group>
                  </el-form-item>
                </el-col>
              </el-row>

              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="用途" prop="useNames">
                    <el-checkbox-group  v-model="admUsecheckList"  disabled  >
                      <el-checkbox
                        v-for="item in utils.getDictDataList('adm_use')"
                        :key="item.value"
                        :label="item.value"
                      >{{item.label}}</el-checkbox>
                    </el-checkbox-group>
                  </el-form-item>
                </el-col>
              </el-row>

              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="申购理由" prop="useReasonNames">
                    <el-checkbox-group disabled  v-model="admUseReasoncheckList"  class="el-checkbox-group-inline"  >
                      <el-checkbox
                        v-for="item in utils.getDictDataList('adm_use_reason')"
                        :key="item.value"
                        :label="item.value"
                      >{{item.label}}</el-checkbox>
                    </el-checkbox-group>
                    <el-input v-model="useReasonOther"  disabled ref="useReasonOther" v-show="hasOther" placement="请输入" />
                  </el-form-item>
                </el-col>
              </el-row>

              <el-row :gutter="20">
                <el-col :span="24">
                  <el-form-item label="科室要求" prop="deptRemark">
                    {{form.deptRemark}}
                  </el-form-item>
                </el-col>
              </el-row>

              <el-row  style="    text-align: center;">
                <el-col :span="12">
                  <FortenEsign
                    :fileSavePath="'adm_matr_apply'"
                    :fileRefTable="'adm_matr_apply'"
                    :fileRefId="form.id+'_nursing_manager'"
                    :propShowSave="false"
                    :propShowSaveUser="false"
                    :propAutoSave="false"
                    :fileRefIdOnlyOne="'1'"
                    ref="auditEsign1"
                    :propWidth="200"
                    :propHeight="100"
                    propTitle="护士长签字"
                    :propDisabled="true"
                    style="    display: inline-block;"
                  ></FortenEsign>
                </el-col>
                <el-col :span="12">
                  <FortenEsign
                    :fileSavePath="'adm_matr_apply'"
                    :fileRefTable="'adm_matr_apply'"
                    :fileRefId="form.id+'_dept_director'"
                    :propShowSave="false"
                    :propShowSaveUser="false"
                    :propAutoSave="false"
                    :fileRefIdOnlyOne="'1'"
                    ref="auditEsign2"
                    :propWidth="200"
                    :propHeight="100"
                    propTitle="科主任签字"
                    :propDisabled="true"
                    style="    display: inline-block; margin-left:11px;"
                  ></FortenEsign>
                </el-col>
              </el-row>
            </el-collapse-item>
            <!--申请材料-->
            <el-collapse-item title="申请材料" name="18" class="target">
              <FortenUpload
                :title="'申请材料'"
                :fileRefTable="'adm_matr_apply'"
                :fileSavePath="'adm_matr_apply'"
                :propStatus="propStatus"
                :fileRefId="propInitData.applyId"
                :fileType="'all'"
                :fileMaxNum="999"
                :fileSize="100"
                 :readonly="true"
              ></FortenUpload>
            </el-collapse-item>


            <!--院内类似品名品规-->
            <el-collapse-item title="院内类似品名品规" name="21">
              <data-view
                propViewKey="select_matr_matrapply"
                ref="dataViewRight"
                class="data-view-inlinebtn"
                @after-load="afterLoad"
                @view-ready="viewReady"
                @current-change="currentChange"
                :propPageSize="10"
                :propAutoFetchData="false"
              >
              </data-view>
            </el-collapse-item>

          </el-collapse>
        </el-col>
      </el-row>

    </el-form>
  </div>
</template>

<script>
/* eslint-disable*/
import FortenUpload from '@/components/common/FortenUpload.vue'
export default {
  title: '查看或者设置询价要求界面',
  data() {
    return {
      form: {},
      viewData: {},
      activeNames: ['11', '12', '13', '21', '22', '66', '15', '16', '18'],
      options: [{
        value: '省网',
        label: '省网'
      }, {
        value: '市网',
        label: '市网'
      }, {
        value: '不确定',
        label: '不确定'
      }],
      certSPNameArr: [],
      certArr: [],
      token: null,
      admUseScopecheck: '',
      admUsecheckList: [],
      admUseReasoncheckList: [],
      hasOther: true,
      useReasonOther: ''
    }
  },
  watch:{
    //视图状态变化后，显示上传操作
    propInitData:{
      handler(newValue, oldValue) {
        if(this.propInitData.applyItemId){
          this.init()
        }
      },
      deep: true,
      immediate: true
    }
  },
  methods: {
    //初始化各区域
    init() {
      //查询审核明细
      this.$ajax.get('/adm/matr_apply_item/find?id=' + this.propInitData.applyItemId, {},{
      }).then(resp => {
        if (resp.code == 0) {
          this.form = resp.data
          this.fetchDataRight()
          this.fetchDataTarget()
          this.fetchDataResult()

          this.admUseScopecheck = this.form.useScopeCodes
          this.admUsecheckList = this.strings.defaultString(this.form.useCodes, '').split(',')
          this.admUseReasoncheckList = this.strings.defaultString(this.form.useReasonCodes, '').split(',')

          //包含其他，则显示其他输入框
          this.hasOther  = this.admUseReasoncheckList.includes('other')
          this.useReasonOther  = this.form.useReasonOther
        }
      })

      this.$ajax.get('/adm/matr_apply/find?id=' + this.propInitData.applyId, {},{
      }).then(resp => {
        if (resp.code == 0) {
          if (resp.data.signPath1) {
            this.$refs.auditEsign1.setSignPath(resp.data.signPath1)
          }
          if (resp.data.signPath2) {
            this.$refs.auditEsign2.setSignPath(resp.data.signPath2)
          }
        }
      })
    },
    //刷新父界面
    fetchParent() {
      this.propParent.fetchData()
    },
    //刷新右侧耗材视图
    fetchDataRight() {

      let matrNameS = this.strings.toStr((this.form.matrName))
      let matrSpecS = this.strings.toStr(this.form.matrSpec)
      let mfgNameS = this.strings.toStr(this.form.mfgName)
      let wrapper = this.$newWrapper()
      if (matrNameS)  wrapper.like('name', matrNameS)
      if (matrSpecS)  wrapper.like('spec', matrSpecS)
      if (mfgNameS)  wrapper.like('mfg_name', mfgNameS)
      this.$refs.dataViewRight.setQueryWrapper(wrapper)
    },
    //刷新右侧询价目标视图
    fetchDataTarget() {
      //固定数据筛选参数
      let wrapper = this.$newWrapper().eq('apply_item_id', this.propInitData.applyItemId)
      this.$refs.dataViewTarget.setQueryWrapper(wrapper)
    },
    //刷新询价结果
    fetchDataResult() {
      //固定数据筛选参数
      let wrapper = this.$newWrapper().eq('audit_item_id', this.propInitData.auditItemId)
      this.$refs.dataViewResult.setQueryWrapper(wrapper)
      this.getCert()
    },
    //查询资质
    async getCert() {
      this.token = await this.utils.getMscmToken()
      let wrapper = this.$newWrapper().eq('audit_id',this.propInitData.auditId )
      const params = {
        queryString: this.utilVue.json2str(wrapper.queryConditions),
        orderString: null
      }
      this.certSPNameArr = []
      this.certArr = []
      this.$ajax.get('adm/matr_inquiry_cert/list', {params}).then(resp => {
        if (resp.code == 0 &&  resp.data && resp.data.length >0) {
          let data = resp.data
          this.certArr = resp.data
          data.filter((row) => !this.certSPNameArr.includes(row.supplierName) && this.certSPNameArr.push(row.supplierName))
        }
      })
    },
    afterLoad() {
    },
    viewReady() {
    },
    //行选中之后
    currentChange(params) {
    },
    //下拉列表选择后
    selectChange({fieldText, row}) {
      if (fieldText == 'categoryName') { //选择分类
        this.$set(this.form, 'categoryId', row.id)
        this.$set(this.form, 'categoryName', row.categoryName)
      }else if (fieldText == 'supplierNameTarget') { //选择完供应商
        this.$set(this.form, 'supplierNameNewTarget', '')
        this.$set(this.form, 'supplierCodeTarget', row.mscmCode)
        this.$set(this.form, 'supplierNameTarget', row.name)
        this.$set(this.form, 'supplierTel', row.telephone)
        this.$set(this.form, 'supplierContactor', row.contacts)
      }
    },
    //添加供应商
    addTarget() {
      let saveData = {}
      saveData.applyId = this.propInitData.applyId
      saveData.applyItemId = this.propInitData.applyItemId
      saveData.auditId = this.propInitData.auditId
      saveData.auditItemId = this.propInitData.auditItemId

      saveData.supplierTel = this.form.supplierTel
      saveData.supplierContactor = this.form.supplierContactor
      saveData.supplierCode = this.form.supplierCodeTarget
      saveData.supplierName = this.form.supplierNameTarget
      if (this.strings.isNotBlank(this.form.supplierNameNewTarget)) { //新供应商
        saveData.supplierCode = ''
        saveData.supplierName = this.form.supplierNameNewTarget
      }
      if (this.strings.isBlank(saveData.supplierName)) {
        this.utilMessage.warning('请选择或者输入新供应商')
        this.$refs.supplierCodeTarget.show()
        return
      }
      if (this.strings.isBlank(saveData.supplierContactor)) {
        this.utilMessage.warning('请输入联系人')
        this.$refs.supplierContactor.show()
        return
      }
      if (this.strings.isBlank(saveData.supplierTel)) {
        this.utilMessage.warning('请输入联系电话')
        this.$refs.supplierTel.show()
        return
      }
      this.utilVue.loadShow(true)
      this.$ajax.post('/adm/matr_inquiry_target/save', saveData).then(resp => {
        if ( resp.code == 0 ){
          this.utilMessage.success(resp.msg)
          this.$set(this.form, 'supplierNameNewTarget', '')
          this.$set(this.form, 'supplierCodeTarget',  '')
          this.$set(this.form, 'supplierNameTarget',  '')
          this.$set(this.form, 'supplierTel',  '')
          this.$set(this.form, 'supplierContactor',  '')
          this.fetchDataTarget()
        }
        this.utilVue.loadHide()
      })
    },
    //1: 保存询价要求 2:保存中标结果 3：选择供应商中标
    saveApplyDtl(type, row) {
      if (type == 1) {
        if (Number(this.form.officialPrice) <=0) {
          this.utilMessage.warning('请设置中标参考价')
          this.$refs.officialPrice.focus()
          return
        }
        if (this.strings.isBlank(this.form.officialPriceSrc)) {
          this.utilMessage.warning('请选择参考价来源')
          this.$refs.officialPriceSrc.focus()
          return
        }
        if (Number(this.form.skuPriceMin) <=0) {
          this.utilMessage.warning('请设置最低限价')
          this.$refs.skuPriceMin.focus()
          return
        }
        if (Number(this.form.skuPriceMax) <=0) {
          this.utilMessage.warning('请设置最高限价')
          this.$refs.skuPriceMax.focus()
          return
        }
        if (Number(this.form.skuPriceMax) < Number(this.form.skuPriceMin)) {
          this.utilMessage.warning('最高限价不能低于最低限价')
          this.$refs.skuPriceMin.focus()
          return
        }
      } else  if (type == 3) { //设置中标
        this.$set(this.form, 'supplierCode', row.supplierCode)
        this.$set(this.form, 'supplierName',  row.supplierName)
        this.$set(this.form, 'skuPricePurchase',  row.skuPriceBid)
        this.$set(this.form, 'skuPriceSell',  row.skuPriceBid)
      }
      this.utilVue.loadShow(true)
      this.$ajax.post('/adm/matr_apply_item/save', this.form).then(resp => {
        if ( resp.code == 0 ){
          this.utilMessage.success(resp.msg)
          this.fetchParent()
        }
        this.utilVue.loadHide()
      })
    },
    //按钮事件
    handleExtraButton(para) {
      switch(para.button.key) {
        case 'reloadResult': //拉取询价结果
          this.utilVue.loadShow(true)
          this.$ajax.get('/mscm/admInquiryPull/'+this.propInitData.auditId).then(resp => {
            if ( resp.code == 0 ){
              this.fetchDataResult()
            }
            this.utilVue.loadHide()
          })
          break
      }
    },
    getSpCert(spName){
      let fileList = []
      this.certArr.filter((row) => row.supplierName == spName).forEach(cert => {
        let certUrls = cert.certUrl ? cert.certUrl.split(',') : []
        let extTypes = cert.extTypes? cert.extTypes.split(',') : []
        for(var i=0; i<certUrls.length; i++) {
          let certUrl = certUrls[i]
          let extType  = null
          if (extTypes != null &&　certUrls.length == extTypes.length)  extType = extTypes[i]
          fileList.push({ext: extType ,name: cert.certName, fileName: cert.certName , url: certUrl + '?X-Token='+ this.token, filePath: certUrl + '?X-Token='+ this.token})
        }
      })

      console.log('fileList', fileList)
      return fileList
    }
  },
  created() {
    this.$emit('event-register', {
      validate: (callback) => {
        this.$refs.editForm.validate(callback)
      },
      beforeSave: () => {
        this.$emit('data-callback', this.form)
        return true
      },
      afterMove: (formData, initData) => {
        this.form = global.utils.jsonClone(formData)
        this.init()
      },
      afterSave: () => {
        this.fetchParent()
      },
      beforeDelete: () => {
        return true
      },
      afterDelete: () => {
      },
      beforeFlow: (flowButtonKey) => {
        return true
      },
      afterFlow: (flowButtonKey) => {
      },
      beforeClose: () => {
        return true
      }
    })
  },
  props: {
    propParent: Object,
    propInitData: Object,
    propPrimaryKey: String,
    propDictionaries: Object,
    propCurrentRow: Object,
    propViewFormData: Object,
    propReadonly: Boolean,
    propStatus: String,
    propRules: Object
  },
  components: {
    FortenUpload
  },
  computed: {
    //自定义列
    propCustomCols(){
      return [
        {
          name: 'btns',
          title: '设置中标',
          cmode: 'extra',
          width: 100,
          queryType: 'none'
        }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
  .container {
    width: 100%;
    height: 100%;

    .area-dept{
      /deep/ .el-form-item{
        margin-bottom: 1px !important;
      }
    }
    .target{
      /deep/ .el-collapse-item{
        margin-left: 22px !important;
      }

      /deep/ .el-collapse-item__header{
        font-size: 13px  !important;
      }
    }
  }
</style>
